<?php
function lilina_adminapi_create($args)
{
    extract($args);
    if (!isset($url)) {
        $msg = xarML('Invalid Parameter Count');
        xarErrorSet(XAR_SYSTEM_EXCEPTION, 'BAD_PARAM', new SystemException($msg));
        return;
    }
    // Security Check
    if(!xarSecurityCheck('AdminLilina')) return;
    // Get datbase setup
    $dbconn =& xarDBGetConn();
    $xartable =& xarDBGetTables();
    $table = $xartable['feeds'];
    $nextId = $dbconn->GenId($table);
    // Add item
    $query = "INSERT INTO $table (
              xar_id,
              xar_url,
              xar_keyword)
            VALUES (
              $nextId,
              ?,
              ?)";

    $bindvars = array($url, $keyword);
    $result =& $dbconn->Execute($query,$bindvars);
    if (!$result) return;

    // Get the ID of the item that we inserted
    $id = $dbconn->PO_Insert_ID($table, 'xar_id');
    // Let any hooks know that we have created a new link
    xarModCallHooks('item', 'create', $id, 'id');
    // Return the id of the newly created link to the calling process
    return $id;
}
?>